import {configureInterceptors} from "@/api";
import axios from "axios";

import type {JsonResult} from "@/api";

const instance = axios.create({
    baseURL: "/v1/role"
});

configureInterceptors(instance);

export interface Role {
    id: number,
    name: string,
    privileges?: string[]
}

export default {
    get: (id: number) => instance.get<JsonResult<Role>>(`/get/${id}`)
};
